package com.yanqu.road.entity.estatewar;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.util.Objects;

/**
 * 乔迁风云战斗记录
 */
public class EstateWarRecord extends DataObject {

	private String recordUid;

	private long userId;

	private boolean isWin;

	private long recordTime;

	private long enemyUserId;

	private UserBaseInfo enemyBaseData = new UserBaseInfo();

	private int oldType;

	private int oldPos;

	private int nowType;

	private int nowPos;

	public String getRecordUid() {
		return recordUid;
	}

	public void setRecordUid(String recordUid) {
		if(!Objects.equals(this.recordUid, recordUid)) {
			this.recordUid = recordUid;
			setUpdateOption();
		}
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		if(this.userId != userId) {
			this.userId = userId;
			setUpdateOption();
		}
	}

	public boolean isWin() {
		return isWin;
	}

	public void setWin(boolean win) {
		if(this.isWin != win) {
			isWin = win;
			setUpdateOption();
		}
	}

	public long getRecordTime() {
		return recordTime;
	}

	public void setRecordTime(long recordTime) {
		if(this.recordTime != recordTime) {
			this.recordTime = recordTime;
			setUpdateOption();
		}
	}

	public long getEnemyUserId() {
		return enemyUserId;
	}

	public void setEnemyUserId(long enemyUserId) {
		if(this.enemyUserId != enemyUserId) {
			this.enemyUserId = enemyUserId;
			setUpdateOption();
		}
	}

	public int getOldType() {
		return oldType;
	}

	public void setOldType(int oldType) {
		if(this.oldType != oldType) {
			this.oldType = oldType;
			setUpdateOption();
		}
	}

	public int getOldPos() {
		return oldPos;
	}

	public void setOldPos(int oldPos) {
		if(this.oldPos != oldPos) {
			this.oldPos = oldPos;
			setUpdateOption();
		}
	}

	public int getNowType() {
		return nowType;
	}

	public void setNowType(int nowType) {
		if(this.nowType != nowType) {
			this.nowType = nowType;
			setUpdateOption();
		}
	}

	public int getNowPos() {
		return nowPos;
	}

	public void setNowPos(int nowPos) {
		if(this.nowPos != nowPos) {
			this.nowPos = nowPos;
			setUpdateOption();
		}
	}

	public UserBaseInfo getEnemyBaseData() {
		return enemyBaseData;
	}

	public String getEnemyBaseDataJsonStr() {
		if(null == enemyBaseData){
			return "{}";
		}else {
			return JSON.toJSONString(enemyBaseData);
		}
	}

	public void setEnemyBaseData(UserBaseInfo enemyBaseData) {
		this.enemyBaseData = enemyBaseData;
		setUpdateOption();
	}
}
